﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Icms.Core.Model;
using Icms.Core.Repository;
using Icms.Infra;

namespace Icms.WebUI.Helpers
{
    public static class ClEditorHelpers
    {
        public static MvcHtmlString ClEditorDropdown(this HtmlHelper html, Guid caseId)
        {
            IList<string> values = new List<string>();
            var c = IoC.Resolve<IRepo<Case>>().Get(caseId);
            values.Add(c.Number);
            values.Add(c.CreatedDate.ToShortDateString());
            values.Add(c.Court.Title);
            values.Add(c.Court.Region.Title);
            
            foreach (var p in c.Parties)
            {
                values.Add(p.Person.FirstName + " " + p.Person.LastName);
            }

            return html.Partial("cledrop", values);
        }
    }
}